<script lang="ts" setup>
import { reactive, onMounted } from 'vue'
import { getContactList } from "@/api/api"
import TabBar from '@/components/TabBar/TabBar.vue'
import { showToast } from 'vant'
import 'vant/es/toast/style'

const state = reactive({
	adinfoList: [],
})

async function getContactData() {
  // 读取广告位数据
  const { data = {} }: any = await getContactList({
    pageNum: 1,
    pageSize: 50,
  })
	state.adinfoList = data.rows || []
}

onMounted(() => {
	showToast("哈喽，你好！")

	// 调用接口示例
	// getContactData()
})
</script>

<template>
	<div>
		<nav-bar :leftArrow='false' />
		<van-cell is-link title="已按需引入vant3 UI组件库">
			<van-icon name="checked" color="#07c160" size="20" />
		</van-cell>
		<van-cell is-link title="已引入flex布局公共样式封装">
			<van-icon name="checked" color="#07c160" size="20" />
		</van-cell>
		<van-cell is-link title="支持rem适配,375和750设计稿">
			<van-icon name="checked" color="#07c160" size="20" />
		</van-cell>
		<van-cell is-link title="支持多环境(开发测试生产环境)">
			<van-icon name="checked" color="#07c160" size="20" />
		</van-cell>
		<van-cell is-link title="已完成axios封装">
			<van-icon name="checked" color="#07c160" size="20" />
		</van-cell>
		<van-cell is-link title="已完成API请求统一管理">
			<van-icon name="checked" color="#07c160" size="20" />
		</van-cell>
		<van-cell is-link title="已实现keep-alive列表状态缓存">
			<van-icon name="checked" color="#07c160" size="20" />
		</van-cell>
		<van-cell is-link title="开发环境自动引入vconsole调试器">
			<van-icon name="checked" color="#07c160" size="20" />
		</van-cell>
		<van-cell is-link title="已实现路由自动注册">
			<van-icon name="checked" color="#07c160" size="20" />
		</van-cell>
		<van-cell is-link title="已实现vuex状态管理模块化">
			<van-icon name="checked" color="#07c160" size="20" />
		</van-cell>
		<van-cell is-link title="顶部导航栏二次封装">
			<van-icon name="checked" color="#07c160" size="20" />
		</van-cell>
		<van-cell is-link title="文件上传组件二次封装">
			<van-icon name="checked" color="#07c160" size="20" />
		</van-cell>
		<tab-bar />
	</div>
</template>

<style lang="less" scoped>
	.test {
		color: var(--color-text);
	}

	div {
		font-size: 12px;
	}
</style>


